package com.edu.study.base.wordBookMember.service.impl;

import com.edu.study.base.wordBookMember.domain.WordBookMember;
import com.edu.study.base.wordBookMember.mapper.WordBookMemberMapper;
import com.edu.study.base.wordBookMember.service.IWordBookMemberService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员的词书Service业务层处理
 * 
 * @author zw
 * @date 2022-04-19
 */
@Service
public class WordBookMemberServiceImpl implements IWordBookMemberService 
{
    @Autowired
    private WordBookMemberMapper wordBookMemberMapper;

    /**
     * 查询会员的词书
     * 
     * @param id 会员的词书ID
     * @return 会员的词书
     */
    @Override
    public WordBookMember selectWordBookMemberById(Long id)
    {
        return wordBookMemberMapper.selectWordBookMemberById(id);
    }

    /**
     * 查询会员的词书列表
     * 
     * @param wordBookMember 会员的词书
     * @return 会员的词书
     */
    @Override
    public List<WordBookMember> selectWordBookMemberList(WordBookMember wordBookMember)
    {
        return wordBookMemberMapper.selectWordBookMemberList(wordBookMember);
    }

    @Override
    public List<WordBookMember> selectMyWordBook(WordBookMember wordBookMember) {
        return wordBookMemberMapper.selectMyWordBook(wordBookMember);
    }

    /**
     * 新增会员的词书
     * 
     * @param wordBookMember 会员的词书
     * @return 结果
     */
    @Override
    public int insertWordBookMember(WordBookMember wordBookMember)
    {
        wordBookMember.setCreateTime(DateUtils.getNowDate());
        return wordBookMemberMapper.insertWordBookMember(wordBookMember);
    }

    /**
     * 修改会员的词书
     * 
     * @param wordBookMember 会员的词书
     * @return 结果
     */
    @Override
    public int updateWordBookMember(WordBookMember wordBookMember)
    {
        return wordBookMemberMapper.updateWordBookMember(wordBookMember);
    }

    @Override
    public int updateBookStatusByIds(String ids) {
        return wordBookMemberMapper.updateBookStatusByIds(ids);
    }

    /**
     * 批量删除会员的词书
     * 
     * @param ids 需要删除的会员的词书ID
     * @return 结果
     */
    @Override
    public int deleteWordBookMemberByIds(Long[] ids)
    {
        return wordBookMemberMapper.deleteWordBookMemberByIds(ids);
    }

    /**
     * 删除会员的词书信息
     * 
     * @param id 会员的词书ID
     * @return 结果
     */
    @Override
    public int deleteWordBookMemberById(Long id)
    {
        return wordBookMemberMapper.deleteWordBookMemberById(id);
    }
}
